<?php include atemplate('header');?>

<table width="96%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="200" height="30" align="left" bgcolor="#B51C00"> 　<span class="STYLE8">兑奖管理（<?php echo $count;?>条）</span></td>
    <td align="right" bgcolor="#B51C00">&nbsp;</td>
    <td width="100" align="center" bgcolor="#B51C00">&nbsp;</td>
    <td width="100" align="center" bgcolor="#B51C00" class="STYLE8">&nbsp;</td>
  </tr>
</table>
<form action="/admin/index.php?do=award&ac=list" method="get">
  <table width="96%" border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td width="300" height="30" align="left"><select name="ifsend" id="ifsend" onchange="this.form.submit()">
          <option value="-1">所有</option>
          <option value="1" <?php echo $ifsend_1;?>>已兑奖</option>
          <option value="0" <?php echo $ifsend_0;?>>未兑奖</option>
        </select></td>
      <td align="right">按照用户名、电话、身份证 搜索：<input name="keyword" type="text" class="STYLE2" id="keyword" value="<?php echo $keyword;?>" />
        <input type="submit"  id="button23" value="搜索" />
        <input type="hidden" name="ac" value="list" />
        <input type="hidden" name="do" value="award" />
        </td>
    </tr>
  </table>
</form>
<table width="96%" border="0" cellpadding="0" cellspacing="1" bgcolor="#999999">
  <tr>
    <td width="60" align="center" valign="middle" bgcolor="#FAFAFA" class="STYLE7">谜语ID</td>
    <td width="" align="center" valign="middle" bgcolor="#FAFAFA" class="STYLE7">谜语标题</td>
    <td width="100" height="40" align="center" bgcolor="#FAFAFA" class="STYLE7">姓 名</td>
    <td width="150" height="40" align="center" valign="middle" bgcolor="#FAFAFA" class="STYLE7">身份证号码</td>
    <td width="200" align="center" valign="middle" bgcolor="#FAFAFA" class="STYLE7">联系电话</td>
    <td width="60" align="center" valign="middle" bgcolor="#FAFAFA" class="STYLE7">状态</td>
    <td width="60" colspan="2" align="center" valign="middle" bgcolor="#FAFAFA" class="STYLE7">操 作</td>
  </tr>
  <?php foreach ($list as $key=>$val) {
	$key %2 == 1 ? $bgcolor = 'bgcolor="#FAFAFA"' : $bgcolor = 'bgcolor="#FFFFF7"';
?>
  <tr <?php echo $bgcolor;?>>
    <td align="center" valign="middle" class="STYLE7"><?php echo $val['id'];?></td>
    <td height="40" align="center"><?php echo $val['title'];?></td>
    <td height="40" align="center"><?php echo $val['username'];?></td>
    <td align="center" valign="middle"><?php echo $val['identity'];?></td>
    <td align="center" valign="middle"><?php echo $val['phone'];?></td>
    <td align="center" valign="middle"><?php echo $val['ifsend']?'已兑':'未兑';?></td>
    <td align="center" valign="middle"><a href="/admin/index.php?do=award&ac=del&id=<?php echo $val['id'];?>" onclick="return confirm('是否删除该用户！');">删除</a></td>
    <td align="center" valign="middle"><a href="/admin/index.php?do=award&ac=send&id=<?php echo $val['id'];?>" onclick="<?php if (!$val['ifsend']){?>return confirm('是否给该用户兑奖！');<?php }else{?>alert('该用户已经兑过奖'); return false;<?php }?>">兑奖</a></td>
  </tr>
  <?php }?>
</table>
<table width="760" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td height="30" align="right" class="page"><?php echo $pagestr;?></td>
  </tr>
</table>
<?php include atemplate('footer');?>
